<template>
  <header>
    <div class="l-content">
      <el-button @click="handlerMenu" plain icon="el-icon-menu" size="mini"></el-button>
      <span style="color:#fff">首页</span>
    </div>
    <div class="r-content">
      <el-dropdown trigger="click" szie="mini">
        <span class="el-dropdown-link">
          <img class="user" :src="userImg" alt="">
        </span>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item>个人中心</el-dropdown-item>
          <el-dropdown-item>退出</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </header>
</template>
<script>
export default ({
  name: 'CommonHeader',
  data () {
    return {
      userImg: require('../assets/logo.png')
    }
  },
  methods: {
    handlerMenu () {
      this.$store.commit('collapseMenu')
    }
  }
})
</script>
<style lang="scss" scoped>
  header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
  }
  .l-content{
    display: flex;
    align-items: center;
    .el-button{
      margin-right: 20px;
    }
  }
  .r-content{
    .user{
      width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #fff;
    }
  }
</style>
